package kr.or.javacafe.sysarraycopy;

public class SysArrayCopyMain {
	public static void main(String[] args) {
		// System.arrayCopy
		int[] a = {1,2,3,4,5};
		
//		int[] b = a; // shallow copy
//		for (int i = 0; i < b.length; i++) {
//			System.out.print(b[i]+",");			
//		}
//		System.out.println();
//		b[2]=0;
//		for (int i = 0; i < b.length; i++) {
//			System.out.print(a[i]+",");			
//		}
		
		int[] c = new int[5];
		System.arraycopy(a, 0, c, 0, a.length);
		System.out.println();
		c[2]=0;
		for (int i = 0; i < a.length; i++) {
			System.out.print(c[i]+",");			
		}		
	}
}





